package model

import (
	"time"

	"github.com/garyburd/redigo/redis"
	"github.com/wtf/mahjong/utils"
)

var RedisClient *redis.Pool

func init() {
	RedisClient = &redis.Pool{
		MaxIdle:     100,
		MaxActive:   2000,
		IdleTimeout: 500 * time.Second,
		Dial: func() (redis.Conn, error) {
			c, err := redis.Dial("tcp", utils.Config.Rds, redis.DialPassword("LimanquLdt0529"))
			if err != nil {
				return nil, err
			}
			return c, nil
		},
	}
}
